package com.gm.springboot.mapper;

import com.gm.springboot.bean.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Author Administrator
 * @Date 2020/7/2 15:46
 **/
public interface StudentMapper {
    @Select("select * from tb_student")
    List<Student> findStudentAll();
    @Insert("insert into tb_student(sid,sname,sphone,sbirth) values(#{sid},#{sname},#{sphone},#{sbirth})")
    int addStudent(Student student);

    @Delete("delete from tb_student where sid=#{sid}")
    int delStudent(Integer sid);
    @Select("select * from tb_student where sid=#{sid}")
    Student findStudentById(Integer sid);
    @Update("update tb_student set sname=#{sname},sphone=#{sphone},sbirth=#{sbirth} where sid=#{sid}")
    int updStudent(Student student);
}
